/*
 * Copyright© 2003-2019 浙江汇信科技有限公司, All Rights Reserved. 
 */
package com.icinfo.cloud.provider.punish.fastcase.controller;

import com.icinfo.cloud.common.core.page.PageResponse;
import com.icinfo.cloud.provider.punish.fastcase.dto.AppCaseAppraiseDetailInfoSaveDto;
import com.icinfo.cloud.provider.punish.fastcase.dto.AppCaseAppraiseRecordByPartyQueryDto;
import com.icinfo.cloud.provider.punish.fastcase.service.ICaseAppraiseRecordService;
import com.icinfo.cloud.provider.punish.fastcase.vo.CaseAppraiseDetailInfoVo;
import com.icinfo.cloud.provider.punish.fastcase.vo.CaseAppraiseRecordCountVo;
import com.icinfo.cloud.provider.punish.fastcase.vo.CaseAppraiseRecordVo;
import com.icinfo.cloud.provider.punish.fastcase.vo.CaseAppraiseTemplateGroupInfoVo;
import com.icinfo.framework.common.web.Result;
import com.icinfo.framework.core.web.BaseController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 【V1.1.0】（安吉速结）描述: 案件评价记录表 case_appraise_record 对应的Controller类.<br>
 *
 * @author framework generator
 * @date 2023年02月02日
 */
@Slf4j
@RestController
@RequestMapping("/app/fastcase/appraise")
public class CaseAppraiseRecordController extends BaseController {

    @Resource
    private ICaseAppraiseRecordService caseAppraiseRecordService;

    /**
     * 【V1.1.0】（安吉速结）描述： 根据当事人身份编码获取待评价记录数
     *
     * @author: zhengqiang
     * @date: 2023/2/6
     * @return {@link Result}
     **/
    @GetMapping("/getCountOfNoAppraiseRecordByParty")
    public Result getCountOfNoAppraiseRecordByParty() {
        return caseAppraiseRecordService.getCountOfNoAppraiseRecordByParty();
    }

    /**
     * 【V1.1.0】（安吉速结）描述： 根据当事人身份编码获取不同评价列表记录数
     *
     * @author: zhengqiang
     * @date: 2023/2/8
     * @return {@link Result< CaseAppraiseRecordCountVo>}
     **/
    @GetMapping("/getCountOfCaseAppraiseRecordByQueryListType")
    public Result<CaseAppraiseRecordCountVo> getCountOfCaseAppraiseRecordByQueryListType() {
        return caseAppraiseRecordService.getCountOfCaseAppraiseRecordByQueryListType();
    }


    /**
     * 【V1.1.0】（安吉速结）描述： 根据当事人查询案件评价记录(分页)
     *
     * @author: zhengqiang
     * @date: 2023/2/2
     * @param: queryDto
     * @return {@link Result< PageResponse< CaseAppraiseRecordVo>>}
     **/
    @PostMapping("/getCaseAppraiseRecordPageListByParty")
    public Result<PageResponse<CaseAppraiseRecordVo>> getCaseAppraiseRecordPageListByParty(@RequestBody @Validated AppCaseAppraiseRecordByPartyQueryDto queryDto) {
        return caseAppraiseRecordService.getCaseAppraiseRecordPageList(queryDto);
    }

    /**
     * 【V1.1.0】（安吉速结）描述： 根据案件id获取案件评价详情
     *
     * @author: zhengqiang
     * @date: 2023/2/3
     * @param: caseId
     * @return {@link Result< CaseAppraiseDetailInfoVo>}
     **/
    @GetMapping("/getCaseAppraiseRecordDetailByCaseId")
    public Result<CaseAppraiseDetailInfoVo> getCaseAppraiseRecordDetailByCaseId(@RequestParam String caseId) {
        return caseAppraiseRecordService.getCaseAppraiseRecordDetailByCaseId(caseId);
    }

    /**
     * 【V1.1.0】（安吉速结）描述： 保存评价信息
     *
     * @author: zhengqiang
     * @date: 2023/2/3
     * @param: appCaseAppraiseDetailInfoSaveDto
     * @return {@link Result}
     **/
    @PostMapping("/saveCaseAppraiseRecord")
    public Result saveCaseAppraiseRecord(@RequestBody AppCaseAppraiseDetailInfoSaveDto appCaseAppraiseDetailInfoSaveDto) {
        return caseAppraiseRecordService.saveCaseAppraiseRecord(appCaseAppraiseDetailInfoSaveDto);
    }

    /**
     * 【V1.1.0】（安吉速结）描述： 根据案件类型获取评价模板
     *
     * @author: zhengqiang
     * @date: 2023/2/6
     * @param: caseType
     * @return {@link Result<  List <  CaseAppraiseTemplateGroupInfoVo >>}
     **/
    @GetMapping("/getCaseAppraiseTemplateInfo")
    public Result<List<CaseAppraiseTemplateGroupInfoVo>> getCaseAppraiseTemplateInfo(@RequestParam String caseType) {
        return caseAppraiseRecordService.getCaseAppraiseTemplateInfo(caseType);
    }

}